<admintpl file="header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:U('Exams/index')}">考试管理</a></li>
			<li><a href="{:U('Exams/add')}">添加考试</a></li>
		</ul>
		<form class="well form-search" method="post" action="{:U('Exams/index')}">
			分类： 
			<select name="term_id" style="width: 120px;">
				<option value='0'>全部</option>{$taxonomys}
			</select> &nbsp;&nbsp;
			考试标题：
			<input type="text" name="keyword" style="width: 200px;" value="{$keyword}" placeholder="请输入题干">
			<input type="submit" class="btn btn-primary" value="搜索" />
			<a class="btn btn-danger" href="{:U('Exams/index')}">清空</a>
		</form>
		<form class="js-ajax-form" action="{:U('Exams/listorders')}" method="post">
			<div class="table-actions">
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit">{:L('SORT')}</button>
			</div>
			<table class="table table-hover table-bordered table-list" id="menus-table">
				<thead>
					<tr>
						<th width="80">{:L('SORT')}</th>
						<th width="50">ID</th>
						<th>考试名称</th>
						<th>考试时间</th>
						<th width="80">{:L('STATUS')}</th>
						<th width="180">{:L('ACTIONS')}</th>
					</tr>
				</thead>
				<tbody>
				<foreach name="exams" item="vo">
				<tr>
					<td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value="{$vo.id}" title="ID:{$vo.id}"></td>
					<td><input name="listorders[{$vo.id}]" class="input input-order" type="text" size="5" value="{$vo.listorder}"></td>
					<td>
						<notempty name="term">
						<a href="{:leuu('admin/Paper/index',array('id'=>$vo['id'],'cid'=>$term['term_id']))}" target="_blank">{$vo.exam_title}</a>
						<else/>
							{$vo.exam_title}
						</notempty>
					</td>			
					<td>{:date('Y-m-d H:i',strtotime($vo['exam_date']))}</td>
					<td>
						<notempty name="vo.exam_status">
							<a data-toggle="tooltip" title="已停用"><i class="fa fa-check"></i></a>
							<else/>
							<a data-toggle="tooltip" title="已启用"><i class="fa fa-close"></i></a>
						</notempty>
					</td>
					<td>
						<a href="{:U('Exams/edit',array('id'=>$vo['id']))}">{:L('EDIT')}</a> | 
						<a href="{:U('Exams/delete',array('id'=>$vo['id']))}" class="js-ajax-delete">{:L('DELETE')}</a>
					</td>
				</tr>
				</foreach>
				</tbody>
				<tfoot>
					<tr>
						<th width="80">{:L('SORT')}</th>
						<th width="50">ID</th>
						<th>考试名称</th>
						<th>考试时间</th>
						<th width="80">{:L('STATUS')}</th>
						<th width="180">{:L('ACTIONS')}</th>
					</tr>
				</tfoot>
			</table>
			<div class="table-actions">
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit">{:L('SORT')}</button>
			</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<script>
		$(document).ready(function() {
			Wind.css('treeTable');
			Wind.use('treeTable', function() {
				$("#menus-table").treeTable({
					indent : 20
				});
			});
		});

		setInterval(function() {
			var refersh_time = getCookie('refersh_time_admin_menu_index');
			if (refersh_time == 1) {
				reloadPage(window);
			}
		}, 1000);
		setCookie('refersh_time_admin_menu_index', 0);
	</script>
</body>
</html>